home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12214 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: sol.caps.maine.edu!bensh
  2. From: bensh@gandalf.UMCS.Maine.EDU (Shawn Benn)
  3. Newsgroups: comp.lang.c
  4. Subject: A solution and another pointer question
  5. Date: 29 Mar 1996 20:31:16 GMT
  6. Organization: University of Maine, Department of Computer Science
  7. Distribution: world
  8. Message-ID: <4jhhak$131a@sol.caps.maine.edu>
  9. NNTP-Posting-Host: gandalf.umcs.maine.edu
  10.  
  11. Hey, all!  Thanks to everyone who sent me an e-mail on my last problem.  It
  12. ended up being that I was changing cls and not *cls.  I fixed this problem
  13. after many hours of starting and experimentation.  But I have another problem
  14. that I am hoping you can make light of.
  15.  
  16. I am trying to seek to the end of a binary file that I opened in the parent
  17. function.  From this I want to find out how many bytes are in the file and
  18. use that value to read in the data.  Here's the syntax I am using:
  19.  
  20. FILE* fil;
  21. char* filename = "junk";      /* junk used just as an example */
  22.  
  23. fil = fopen(filename, "rb");
  24. fseek(fil, 0L, SEEK_END);
  25.  
  26. I get a Segmentation Fault error here trying to get to the end of the file.
  27.  
  28. Any ideas?  Thanks again for any help.  
  29.  
  30. Shawn Benn
  31. University of Maine
  32.